package com.filldream.fastboot.web.controller.common;

import com.filldream.fastboot.base.request.SendCodeSTO;
import com.filldream.fastboot.common.entity.B;
import com.filldream.fastboot.core.manager.SmsRecordManager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;


/**
 * @author RickSun && iFillDream
 * @version 1.0
 * @data 2020-05-07 17:49
 * @description AccountController
 */
@Api(tags = "短信接口")
@RestController
@RequestMapping("/common/sms")
public class SmsController {

    @Autowired
    private SmsRecordManager smsRecordManager;

    @PostMapping("/sendCode")
    @ApiOperation(value = "发送验证码")
    public B sendCode(@RequestBody @Valid SendCodeSTO sendCodeSTO){
        return smsRecordManager.sendPhoneCode(sendCodeSTO);
    }

}
